/*Joseph A. Coll
FD and Stereotypes Map
7/9/2023*/

********************************************************************************
*F1-Map of Felon Disenfranchisement Policies
********************************************************************************
use "State Name Abbreviation Region Division.dta",clear

gen fd_policy = .		
replace fd_policy = 1 if state_name == "District of Columbia"
replace fd_policy = 1 if state_name == "Maine"
replace fd_policy = 1 if state_name == "Vermont"
replace fd_policy= 2 if state_name == "California"
replace fd_policy= 2 if state_name == "Colorado"
replace fd_policy= 2 if state_name == "Connecticut"
replace fd_policy= 2 if state_name == "Hawaii"
replace fd_policy= 2 if state_name == "Illinois"
replace fd_policy= 2 if state_name == "Indiana"
replace fd_policy= 2 if state_name == "Maryland"
replace fd_policy= 2 if state_name == "Massachusetts"
replace fd_policy= 2 if state_name == "Michigan"
replace fd_policy= 2 if state_name == "Minnesota"
replace fd_policy= 2 if state_name == "Montana"
replace fd_policy= 2 if state_name == "Nevada"
replace fd_policy= 2 if state_name == "New Hampshire"
replace fd_policy= 2 if state_name == "New Jersey"
replace fd_policy= 2 if state_name == "New York"
replace fd_policy= 2 if state_name == "New Mexico"
replace fd_policy= 2 if state_name == "North Dakota"
replace fd_policy= 2 if state_name == "Ohio"
replace fd_policy= 2 if state_name == "Oregon"
replace fd_policy= 2 if state_name == "Pennsylvania"
replace fd_policy= 2 if state_name == "Rhode Island"
replace fd_policy= 2 if state_name == "Utah"
replace fd_policy= 2 if state_name == "Washington"
replace fd_policy= 3 if state_name == "Alaska"
replace fd_policy= 3 if state_name == "Arkansas"
replace fd_policy= 3 if state_name == "Georgia"
replace fd_policy= 3 if state_name == "Idaho"
replace fd_policy= 3 if state_name == "Kansas"
replace fd_policy= 3 if state_name == "Louisiana"
replace fd_policy= 3 if state_name == "Missouri"
replace fd_policy= 3 if state_name == "Nebraska"
replace fd_policy= 3 if state_name == "North Carolina"
replace fd_policy= 3 if state_name == "Oklahoma"
replace fd_policy= 3 if state_name == "South Carolina"
replace fd_policy= 3 if state_name == "South Dakota"
replace fd_policy= 3 if state_name == "Texas"
replace fd_policy= 3 if state_name == "West Virginia"
replace fd_policy= 3 if state_name == "Wisconsin"
replace fd_policy= 4 if state_name == "Alabama"
replace fd_policy= 4 if state_name == "Arizona"
replace fd_policy= 4 if state_name == "Delaware"
replace fd_policy= 4 if state_name == "Florida"
replace fd_policy= 4 if state_name == "Iowa"
replace fd_policy= 4 if state_name == "Kentucky"
replace fd_policy= 4 if state_name == "Mississippi"
replace fd_policy= 4 if state_name == "Tennessee"
replace fd_policy= 4 if state_name == "Virginia"
replace fd_policy= 4 if state_name == "Wyoming"
label def fd_policy 1 "No Disenfranchisement" 2 "During Incarceration" 3 "Until Sentence Completion" 4 "Post-Sentence Waiting Period/Additional Action"
label val fd_policy fd_policy
label var fd_policy "FDPolicy"

rename state_fips statefips

maptile fd_policy, geo(state) geoid(statefips) savegraph(fd_policy) replace ///
cutvalues(1.9 2.9 3.9) twopt(legend(on col(2) region(lpattern(solid) lcolor(black)) ///
order(2 "No Disenfranchisement" 3 "During Incarceration" 4 "Until Sentence Completetion" 5 "Post-Sentence Waiting Period/Additional Action")))
graph export FD_map.png, replace
graph save FD_map, replace
